function qs = ElnqmuLambda_losses(mix)

% E[ln q(mu, Lambda)]

[K D] = size(mix.centres);

% posteriors
b = mix.varposterior.b;
W = mix.varposterior.W;
v = mix.varposterior.v;

% expectations of logdet
ElndetLambda = mix.varposterior.ElndetLambda;

q = 0.5*ElndetLambda + 0.5*D*log(b/(2*pi)) - 0.5*D;
for k = 1:K
    q(k) = q(k) - wishart_entropy(W(:, :, k), v(k), ElndetLambda(k));
end

qs = sum(q)-q;



function e = wishart_entropy(W, v, ElndetLambda)

D = size(W,1);
e = -wishartln_denom(W, v) - 0.5*(v-D-1)*ElndetLambda + 0.5*v*D;
